﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;

namespace Coleotrack.Data.Maps
{
    public class AreaMap : ClassMap<Area>
    {
        public AreaMap()
        {
            Id(x => x.Id).GeneratedBy.Identity();
            
            Map(x => x.Name).Not.Nullable().Length(255).UniqueKey("IX_Name");

            References(x => x.Project).Not.Nullable().UniqueKey("IX_Name");
            References(x => x.Parent).Nullable().UniqueKey("IX_Name");
        }
    }
}
